package com.gamelife.web.constant;


import com.gamelife.web.exception.ServiceException;
import org.springframework.http.HttpStatus;

public enum ResponseEnum {


    OK(200,"操作成功"),
    ERROR(500,"操作失败"),
    CaptchaExpireException(-101,"验证码过期"),
    CaptchaErrorException(-102,"验证码错误"),
    UserPasswordNotMatchException(-110,"用户名或密码错误"),
    TokenFailure(-111,"令牌过期，请重新登录"),
    TokenInvalid(-112,"令牌无效，请重新登录"),
    ServiceException(-200,"服务异常"),
    FORBIDDEN(HttpStatus.FORBIDDEN.value(), "权限不足"),
    UNAUTHORIZED(HttpStatus.UNAUTHORIZED.value(), "认证失败请重新登录")
    ;

    private Integer code;
    private String msg;

    ResponseEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
